package com.bringway.framework.domain;

import org.apache.commons.lang3.StringUtils;

public class TreeNode {
	private String id;

	private String parentId; // 父节点id

	private String px;
	
	private String text;

	private boolean expanded;

	private boolean disabled;

	private String icon;

	private String cls;

	private String iconCls;
	
	private String params;

	private boolean async;

	private boolean isLeaf=false;
	private boolean isIsParent=true;

	private String childct;

	private String url;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	public String getPx() {
		return px;
	}
	
	public void setPx(String px) {
		this.px = px;
	}

	public boolean isExpanded() {
		return expanded;
	}

	public void setExpanded(boolean expanded) {
		this.expanded = expanded;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getCls() {
		return cls;
	}

	public void setCls(String cls) {
		this.cls = cls;
	}

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	public boolean isAsync() {
		return async;
	}

	public void setAsync(boolean async) {
		this.async = async;
	}

	public boolean isLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}

	public boolean isisParent() {
		return isIsParent;
	}

	public void setIsParent(boolean isIsParent) {
		this.isIsParent = isIsParent;
	}

	public String getChildct() {
		return childct;
	}

	public void setChildct(String childct) {
		this.childct = childct;
		if (StringUtils.isNotEmpty(this.childct)) {
			int num = Integer.parseInt(this.childct);
			if (num > 0) {
				this.setIsLeaf(false);
				this.setIsParent(true);
			} else {
				this.setIsLeaf(true);
				this.setIsParent(false);
			}
		}
	}

	public void setLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	
}
